/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DAL;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Mr Bao
 */
@Entity
@Table(name = "imageupload", catalog = "upanhv2", schema = "")
@NamedQueries({
    @NamedQuery(name = "Imageupload.findAll", query = "SELECT i FROM Imageupload i"),
    @NamedQuery(name = "Imageupload.findById", query = "SELECT i FROM Imageupload i WHERE i.id = :id"),
    @NamedQuery(name = "Imageupload.findByAlbumId", query = "SELECT i FROM Imageupload i WHERE i.albumId = :albumId"),
    @NamedQuery(name = "Imageupload.findByName", query = "SELECT i FROM Imageupload i WHERE i.name = :name"),
    @NamedQuery(name = "Imageupload.findByNameFile", query = "SELECT i FROM Imageupload i WHERE i.nameFile = :nameFile"),
    @NamedQuery(name = "Imageupload.findByDateUpload", query = "SELECT i FROM Imageupload i WHERE i.dateUpload = :dateUpload"),
    @NamedQuery(name = "Imageupload.findByIsDelete", query = "SELECT i FROM Imageupload i WHERE i.isDelete = :isDelete"),
    @NamedQuery(name = "Imageupload.findByCategoryId", query = "SELECT i FROM Imageupload i WHERE i.categoryId = :categoryId")})
public class Imageupload implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "Id", nullable = false)
    private Integer id;
    @Column(name = "AlbumId")
    private Integer albumId;
    @Column(name = "Name", length = 50)
    private String name;
    @Column(name = "NameFile", length = 50)
    private String nameFile;
    @Column(name = "DateUpload")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateUpload;
    @Column(name = "IsDelete")
    private Boolean isDelete;
    @Column(name = "CategoryId")
    private Integer categoryId;

    public Imageupload() {
    }

    public Imageupload(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAlbumId() {
        return albumId;
    }

    public void setAlbumId(Integer albumId) {
        this.albumId = albumId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNameFile() {
        return nameFile;
    }

    public void setNameFile(String nameFile) {
        this.nameFile = nameFile;
    }

    public Date getDateUpload() {
        return dateUpload;
    }

    public void setDateUpload(Date dateUpload) {
        this.dateUpload = dateUpload;
    }

    public Boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Boolean isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Imageupload)) {
            return false;
        }
        Imageupload other = (Imageupload) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "DAL.Imageupload[id=" + id + "]";
    }

}
